const validatePhone = (rule, value, callback) => {
  if (!/^1[3456789]\d{9}$/.test(value)) {
    callback(new Error("请输入正确的手机号"));
  } else {
    callback();
  }
};

export const applyOption = {
  border: true,
  stripe: true,
  menuAlign: 'center',
  editBtn: false,
  labelWidth: '200',
  delBtn: false,
  addBtn: false,
  searchSpan: 7,
  align: 'center',
  column: [{
      label: '用户ID',
      prop: 'id',
      search: true,
      addDisplay: false,
      editDisabled: true,
      span: 24,
    }, {
      label: '用户昵称',
      prop: 'nickname',
      editDisabled: true,
      span: 24,
      search: true
    }, {
      label: '注册手机',
      prop: 'mobile',
      width: 100,
      search: true,
      span: 24
    }, {
      label: '微信',
      prop: 'weixin',
      span: 24,
    }, {
      label: '创建时间',
      editDisplay: false,
      width: 100,
      prop: 'register_time'
    },
    {
      label: "VIP身份",
      search: true,
      editDisplay: false,
      prop: "is_vip",
      type: "radio",
      dicData: [{
          label: "非会员",
          value: 0
        },
        {
          label: "VIP",
          value: 1
        },
        {
          label: "SVIP",
          value: 2
        }
      ],
    }, {
      label: "认证状态",
      search: true,
      editDisplay: false,
      prop: "is_auth",
      type: "radio",
      dicData: [{
          label: "否",
          value: 0
        },
        {
          label: "普通认证",
          value: 1
        },
        {
          label: "高级认证",
          value: 2
        }
      ],
    }, {
      label: '姓名',
      span: 24,
      prop: 'name'
    }, {
      label: '公司',
      span: 24,
      prop: 'company',
    }, {
      label: '职位',
      span: 24,
      prop: 'position',
    }, {
      label: '开通时间',
      prop: 'create_time',
      width: 140,
      addDisplay: false,
      editDisplay: false
    }, {
      label: '到期时间',
      prop: 'end_time',
      type: 'date',
      slot: true,
      width: 140,
      span: 24,
    }, {
      label: '到期状态',
      prop: 'is_end',
      type: "radio",
      search: true,
      hide: true,
      addDisplay: false,
      editDisplay: false,
      dicData: [{
          label: "未到期",
          value: 0
        },
        {
          label: "已到期",
          value: 1
        }
      ],
    },
    {
      label: "黑名单",
      slot: true,
      editDisplay: false,
      prop: "status"
    },
  ]
}

export const payLogOption = {
  border: true,
  stripe: true,
  menuAlign: 'center',
  menuWidth: 130,
  editBtn: false,
  delBtn: false,
  addBtn: false,
  viewBtn: true,
  align: 'center',
  column: [{
    label: '订单号',
    prop: 'out_trade_no',
    span: 24,
  }, {
    label: '用户昵称',
    prop: 'nickname',
    span: 24,
  }, {
    label: '用户姓名',
    prop: 'name',
    span: 24,
  }, {
    label: '注册手机',
    prop: 'mobile',
    width: 100,
    span: 24
  }, {
    label: "VIP等级",
    prop: "is_vip",
    span: 24,
    type: "radio",
    dicData: [{
        label: "VIP",
        value: 1
      },
      {
        label: "SVIP",
        value: 2
      }
    ],
  }, {
    label: "支付用途",
    prop: "type",
    span: 24,
    type: "radio",
    dicData: [{
        label: "未知",
        value: 0
      },
      {
        label: "认证",
        value: 1
      },
      {
        label: "续费",
        value: 2
      }
    ],
  }, {
    label: '支付金额',
    prop: 'total',
    span: 24
  }, {
    label: '购买时长(月)',
    prop: 'time',
    span: 24
  }, {
    label: '购买类型',
    prop: 'level',
    span: 24,
    type: "radio",
    dicData: [{
        label: "VIP",
        value: 1
      },
      {
        label: "SVIP",
        value: 2
      }
    ],
  }, {
    label: '支付状态',
    prop: 'pay_status',
    span: 24,
    type: "radio",
    dicData: [{
        label: "未支付",
        value: 0
      },
      {
        label: "已支付",
        value: 1
      }
    ],
  }, {
    label: '订单时间',
    prop: 'create_time',
    span: 24
  },]
}
